<?php
/*************************************************

平台主模型 - the 
Author: Reload <17-10-20>

*************************************************/
namespace Home\Model;
use Think\Model\RelationModel;
class PlatformModel extends RelationModel {
    //查询多条数据
    public function get_all($map,$field='*',$order='`order` asc'){
        $data = $this->where($map)->field($field)->order($order)->select();
        return $data;
    }    
     public function get_all_page($map,$page,$pagenum,$order='`order` asc'){
        $data = $this->where($map)->field($field)->limit($page,$pagenum)->order($order)->select();
        return $data;
    }   

    //查询单数据
    public function get_one($map,$field='*'){
        $data = $this->where($map)->field($field)->find();
        return $data;
    }

    //更新
    public function edit($map,$data){
        $r = $this->where($map)->save($data);
        return $r;
    }

    //添加
    public function add($data){
        $data =M('Platform')->data($data)->add();
        return $data;
    }

    public function count($map=''){
        $data =M('Platform')->where($map)->count();
        return $data;
    }
    

}